package com.cy.pj.common.pojo;


/*封装服务端响应到客户端的结果*/
public class ResponseResult {
//    响应状态码, 1表示OK, 0表示false
    private Integer state = 1;

//    响应状态码对应的响应信息
    private String message = "OK";

//    正确的相应数据
    private Object data;

    public ResponseResult(String message){
        this.message = message;
    }

    public ResponseResult(Object data){
        this.data = data;
    }

    public ResponseResult(Throwable e){
        this.state = 0;
        this.message = e.getMessage();
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
